﻿package game 
{
	import fl.controls.Button;
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import game.events.EventData;
	import game.exchangeddata.HashTable;

	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)
	 */
	public class HotLinePanel extends MovieClip
	{
		
		public var txtTitleTf:TextField;
		public var txtPlaceTf:TextField;
		public var txtPhoneTf:TextField;
		public var txtCloseTf:TextField;
		public var btnClose:SimpleButton;
		public function HotLinePanel() 
		{
			hide();
			txtTitleTf.mouseEnabled = false;
			txtPlaceTf.mouseEnabled = false;
			txtPhoneTf.mouseEnabled = false;
			txtCloseTf.mouseEnabled = false;
			btnClose.addEventListener(MouseEvent.CLICK, hdlEventClick);
		}
		/**
		 * @author	Bamboo
		 * @param	e
		 */
		private function hdlEventClick(e:Event):void 
		{
			hide();
		}
		/**
		 * @author	Bamboo
		 * @param	hashTableInfo
		 */
		public function initText(hashTableInfo:HashTable):void {
			trace("initTextHotLine");
			txtTitleTf.text = hashTableInfo.lookupString("hotlineMsg");
			txtPlaceTf.htmlText = hashTableInfo.lookupString("hotline1");
			txtPhoneTf.htmlText = hashTableInfo.lookupString("hotline2");
			txtCloseTf.text = hashTableInfo.lookupString("btnclose");	;
		}
		/**
		 * @author	Bamboo
		 */
		public function hide():void {
			this.visible = false;
		}
		/**
		 * @author	Bamboo
		 */
		public function show():void {
			trace("show hotline");
			this.visible = true;
		}
	}

}